<script type="text/javascript">
    (function ($) {
        function trH(item, w1) {
            return `<tr>
                        <td>
                            <a href="#">
                                <img style="border:0; ${w1}display:block; margin:0 auto; padding:0; overflow:hidden;" src="./images/${item}" alt="Redmi Note 3 Pro 3GB 32GB Plata">
                            </a>
                        </td>
                    </tr>`
        }
        function trT(item) {
            return `<tr>
                        <td style="font-family: 'microsoft yahei',Arial, Helvetica,Arial,sans-serif; text-align: center;">
                            <p style=" font-size: 28px; color: #e53935; font-weight: bold; line-height: 25px; margin: 25px 0px 5px 0px;">${item}</p>
                            <span style="font-size: 16px; color: #e53935; padding: 3px 8px 5px; background: #ffaaa8; border-radius: 3px;display: inline-block;">Almacén en España</span>
                        </td>
                    </tr>
                    <tr>
                        <td height="15"></td>
                    </tr>`
        }
        function tdT(item) {
            return `<td width="155" style="vertical-align:bottom;background:#${item};">
                    ${str1_1}>
                        <tbody>
                            <tr>
                                <td style="font-family: 'microsoft yahei',Arial, Helvetica,Arial,sans-serif; text-align: left;">
                                    <a href="#" style="text-decoration: none;color:#333;display: block;">
                                        <span style="font-size:16px;line-height: 16px;display:block;font-weight:bold;">Redmi Note 3 Pro</span>
                                        <span style="font-size:14px;line-height: 14px;display:block;margin-bottom: 14px;">3GB 32GB Plata</span>
                                        <span style="font-size:14px;line-height: 14px;display:block;text-decoration: line-through">239.99€</span>
                                        <font style="line-height: 30px;display:block;color:#e53935">
                                            <span style="font-size:30px;font-weight: bold;">214</span>
                                            <span style="font-size:20px;">.99€</span>
                                        </font>
                                        <font style="line-height: 26px; display: block; color: #fff; height: 26px;">
                                            <span style="font-size:14px;background:#e53935;padding:3px 10px;">Comprar &gt;&gt;</span>
                                        </font>
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td height="15"></td>
                            </tr>
                        </tbody>
                    </table>
                </td>`
        }
        function trTH(item) {
            return `<tr>
                        <td height="${item}" style="background:#EAC687">
                        </td>
                        <td height="${item}" width="10" style="background:#EAC687">
                        </td>
                        <td height="${item}" width="10" style="vertical-align:bottom;">
                        </td>
                    </tr>`
        }
        var str1_1 = `<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center"`,
            str1 = `<td width="155" style="vertical-align:bottom;background:#BFBFBF;">
                    ${str1_1}>
                        <tbody>
                            <tr>
                                <td style="font-family: 'microsoft yahei',Arial, Helvetica,Arial,sans-serif; text-align: left;">
                                    <a href="#" style="text-decoration: none;color:#333;display: block;">
                                        <span style="font-size:16px;line-height: 16px;display:block;font-weight:bold;">Redmi Note 3 Pro</span>
                                        <span style="font-size:14px;line-height: 14px;display:block;margin-bottom: 14px;">3GB 32GB Plata</span>
                                        <span style="font-size:14px;line-height: 14px;display:block;text-decoration: line-through">239.99€</span>
                                        <font style="line-height: 30px;display:block;color:#e53935">
                                            <span style="font-size:30px;font-weight: bold;">214</span>
                                            <span style="font-size:20px;">.99€</span>
                                        </font>
                                        <font style="line-height: 26px; display: block; color: #fff; height: 26px;">
                                            <span style="font-size:14px;background:#e53935;padding:3px 10px;">Comprar &gt;&gt;</span>
                                        </font>
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td height="15"></td>
                            </tr>
                        </tbody>
                    </table>
                </td>`,
            str2 = `<td style=" vertical-align:bottom;">
                    ${str1_1}>
                        <tbody>
                            <tr>
                                <td style="vertical-align:bottom;background:#EAC687">
                                    ${str1_1}>
                                        <tbody>
                                            <tr>
                                                <td height="15"></td>
                                            </tr>
                                            ${trH('201608293-1.png', '') + trH('201608293-2.png', '')}
                                        </tbody>
                                    </table>
                                </td>
                                <td width="10" style="vertical-align:bottom;background:#EAC687"></td>
                                <td width="10" style="vertical-align:bottom;"></td>
                            </tr>
                            ${trTH('5')}
                        </tbody>
                    </table>
                    ${str1_1} style="background:#FEFF91;">
                        <tbody>
                            <tr>
                                <td height="10"></td>
                            </tr>
                            <tr>
                                <td style="vertical-align:middle;font-family: 'microsoft yahei',Arial, Helvetica,Arial,sans-serif; text-align: center;">
                                    <a href="#" style="text-decoration: none;display:block;">
                                        <span style="color:#333;font-size:14px;line-height: 15px;">Redmi Note 3 Pro 3GB
                                            <br> 32GB Plata</span>
                                        <font style="display: block;line-height:30px;height:30px;margin:5px 0px 0px 0px;">
                                            <span style="color:#333;font-size:14px;text-decoration: line-through;">239.99€</span>
                                            <span style="font-size:30px;font-weight: bold;color:#e53935;">214</span>
                                            <span style="font-size:20px;color:#e53935;">.99€</span>
                                        </font>
                                        <span style="color:#e53935;font-size:14px;">Comprar &gt;&gt;</span>
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td height="10"></td>
                            </tr>
                        </tbody>
                    </table>
                    ${str1_1}>
                        <tbody>
                            ${trTH('15')}
                        </tbody>
                    </table>
                </td>`,
            str3 = `<tr>
                <td width="10" style="vertical-align:top;"></td>
                <td width="155" style="vertical-align:top;"></td>
                <td style="vertical-align:top;">
                    <a href="#">
                        <img style="border:0; display:block; margin:0 auto; padding:0; overflow:hidden;" src="./images/201608293-2.png" alt="Redmi Note 3 Pro 3GB 32GB Plata">
                    </a>
                </td>
                <td style=" vertical-align:top;">
                    <a href="#">
                        <img style="border:0; display:block; margin:0 auto; padding:0; overflow:hidden;" src="./images/201608293-2.png" alt="Redmi Note 3 Pro 3GB 32GB Plata">
                    </a>
                </td>
                <td width="155" style=" vertical-align:top;"></td>
            </tr>`,
            str4 = ` <td width="10"></td>
                <td width="10" style="background:#EAC687"></td>`,
            str5 = `<tr>
                    <td height="15"></td>
                </tr>
                <tr>
                    <td>
                        ${str1_1}>
                            <tbody>
                                <tr>
                                    ${str4 + str2 + str4 + str2 + str4 + str2}
                                    <td width="10"></td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>`;
        var str10 = `${str1_1} style="background:#dddddd;">
                        <tbody>
                            ${trH('201608291.jpg', 'width:100%;')}
                            <tr>
                                <td>
                                    ${str1_1} style="border: 3px dashed #009900; border-radius: 10px;background:#fff;">
                                        <tbody>
                                            <tr>
                                                <td width="45%" style="vertical-align:middle;">
                                                    <img style="width:100%; border:0; display:block; margin:0; padding:0; overflow:hidden;" src="./images/2016082913.jpg"
                                                        alt="Código：GV4FINAGO">
                                                </td>
                                                <td width="55%" style="vertical-align:middle;padding-left:10px;">
                                                    <div style="font-family: 'microsoft yahei',Arial, Helvetica,Arial,sans-serif; text-align: left;">
                                                        <p style="font-size:14px;color:#4A4A4A; margin:0px;">www.geekvida.es</p>
                                                        <p style="font-size:24px;color:#4A4A4A; margin:0px;">Código：
                                                            <span style="font-weight:bold;color:#009900;">GV4FINAGO</span>
                                                        </p>
                                                        <p style="font-size:15px;color:#4A4A4A; margin:0px;">Compras iguales o superiores
                                                            <span style="color:#009900;">a 99€, -5€</span>
                                                        </p>
                                                        <p style="font-size:15px;color:#4A4A4A; margin:0px;">Compras iguales o superiores
                                                            <span style="color:#009900;">a 149€, -8€</span>
                                                        </p>
                                                        <p style="font-size:15px;color:#4A4A4A; margin:0px;">Compras iguales o superiores
                                                            <span style="color:#009900;">a 249€, -12€</span>
                                                        </p>

                                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                            ${trT('XIAOMI MÓVILES')}
                            <tr>
                                <td>
                                    ${str1_1}>
                                        <tbody>
                                            <tr>
                                                <td width="10" style="vertical-align:bottom;background:#BFBFBF;"></td>
                                                ${tdT('BFBFBF')}
                                                <td style=" vertical-align:bottom;background:#BFBFBF;">
                                                    ${str1_1}>
                                                        <tbody>
                                                            <tr>
                                                                <td height="15"></td>
                                                            </tr>
                                                            ${trH('201608293-1.png', '')}
                                                        </tbody>
                                                    </table>
                                                </td>
                                                <td style=" vertical-align:bottom;background:#EAC687;">
                                                    ${str1_1}>
                                                        <tbody>
                                                            <tr>
                                                                <td height="15"></td>
                                                            </tr>
                                                            ${trH('201608293-1.png', '')}
                                                        </tbody>
                                                    </table>
                                                </td>
                                                ${tdT('EAC687')}
                                            </tr>
                                            ${str3}
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                            ${str5 + trT('XIAOMI GADGETS')}
                            <tr>
                                <td>
                                    ${str1_1}>
                                        <tbody>
                                            <tr>
                                                <td width="10" style="vertical-align:bottom;background:#BFBFBF;"></td>
                                                ${tdT('BFBFBF')}
                                                <td style=" vertical-align:bottom;background:#BFBFBF;">
                                                    ${str1_1}>
                                                        <tbody>
                                                            <tr>
                                                                <td height="15"></td>
                                                            </tr>
                                                            ${trH('201608293-1.png', '')}
                                                        </tbody>
                                                    </table>
                                                </td>

                                                <td style=" vertical-align:bottom;background:#EAC687;">
                                                    ${str1_1}>
                                                        <tbody>
                                                            <tr>
                                                                <td height="15"></td>
                                                            </tr>
                                                            ${trH('201608293-1.png', '')}
                                                        </tbody>
                                                    </table>
                                                </td>
                                                 ${tdT('EAC687')}
                                            </tr>
                                            ${str3}
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                            ${str5}
                            <tr><td height="20"></td></tr>
                            <tr>
                                <td style="vertical-align: middle; font-family: 'microsoft yahei',Arial, Helvetica,Arial,sans-serif; text-align: center; height: 33px; line-height: 33px;">
                                    <a href="#" style="font-size: 16px; color: #fff; background: #e53935; padding: 5px 15px; text-decoration: none;">Más detalles &gt;&gt;</a>
                                </td>
                            </tr>
                            <tr><td height="20"></td></tr>
                        </tbody>
                    </table>`;
        $("#main").prepend(str10);
    })(jQuery);
</script>